package com.monitor.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.monitor.entity.JfzCarType;
import com.monitor.service.JfzCarTypeService;
import com.monitor.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//汽车分类
@RestController
@RequestMapping("/carType")
@Api(description="汽车分类")
public class JfzCarTypeController {
	@Autowired
	private JfzCarTypeService jfzCarTypeService;
	
	@RequestMapping("/updateType")
	public Integer updateType(int carId,int type) {
		return jfzCarTypeService.updateType(carId, type);
	}


	@RequestMapping("/getTypeList")
	@ApiOperation("查询所有车辆类型")
	@ApiImplicitParams({
           /* @ApiImplicitParam(name = "id", value = "id", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "name", value = "部门名称", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "parentId", value = "父id", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "customerCode", value = "客户编号", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "custId", value = "客户ID", required = false, dataType = "int", paramType = "query")*/
	})
	public @ResponseBody
	Result<List<JfzCarType>> getTypeList() {
		Result<List<JfzCarType>> result=new Result<List<JfzCarType>>();
		try{
			result.setCount(1);
			result.setData(jfzCarTypeService.selectList(new EntityWrapper<JfzCarType>()));
		}catch (Exception e){e.printStackTrace();}
		return result;
	}





}
